
local sx_list = {
    {'力量','敏捷'},
    {'力量','智力'},
    {'敏捷','力量'},
    {'敏捷','智力'},
    {'智力','力量'},
    {'智力','敏捷'},
}
ac.item('属性转换宝石'){
    item_type = "charged",
    auto_merge = true,
    count = 1,
    cool = 0.2,
    model = [[SXZHS.mdl]],
    art = [[图标\wp_zhbs.blp]],
    tip = [[选择一项属性，转成另外的属性（三选一）]],
    on_use = function(self, item)
        local unit = self.owner
        local player = unit.owner
        local hero = player.hero
        local list = table.random_table(sx_list,3)
        local show = {}
        for a,da in ipairs(list) do
            local name1 = da[1]
            local name2 = da[2]
            local tip = ('转化10%%%s为%s'):format(name1,name2)
            show[a] = {
                name = tip,
                key1 = ('基础%s'):format(name1),
                key2 = ('基础%s'):format(name2),
            }
        end
        show[4] = {name = '放弃选择'}

        player:notify('玩家-添加选择框',player,'转化属性',show,function(data,index)
            if not data or index==4 then
                --unit:add_item('属性转换宝石',{owner_player = player})
                return
            end
            local key1 = data.key1
            local key2 = data.key2
            local num1 = math.floor(hero:get(key1) * 0.1)
            hero:add(key1,-num1)
            hero:add(key2,num1)
            player:send_msg(('[转化]%s-%s %s+%s'):format(key1,num1,key2,num1))
        end)
    end
}